package custom.tree;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseMotionListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Vector;

import javax.swing.DropMode;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;

import kr.db.EmployeeSearchDTO;
import main.Main;
import voSetting.ChattingVO;
import voSetting.EmployeeSearchVO;
import chat.Chatting;
import chat.Note;
import file.FileTransfer;
import javax.swing.border.LineBorder;
import javax.swing.ImageIcon;



public class EmployeesSearch extends JFrame {

	Point point = new Point();  
	boolean resizing = false; 
   EmployeeSearchVO esvo = new EmployeeSearchVO();
   EmployeeSearchDTO esDto = new EmployeeSearchDTO();

   CustomTreeNode dm_root;
   CustomTreeNode dm_group;
   CustomTreeNode dm_team;
   CustomTreeNode dm_name;
   
   ArrayList<EmployeeSearchVO> al;
   int click_number = -1;
   Vector<String> v_selected = new Vector<String>(); // Employees Selected list
   Vector<String> v_selected_chat = new Vector<String>(); // 채팅 리스트에 담을 것
   Note note_f;
   Chatting chat_f;
   FileTransfer file_f;
   Main main;

   int type;
   String group;
   String team;
   
   boolean DEBUG = true; // no use if you don't want print the console
   boolean check = false; // scrollpane is created or not
   private JPanel panel;
   private JScrollPane scrollPane;
   public JButton btn_search;
   private JTree tree;
   private JTextField txt_search;

   static TreeCellRenderer renderer = null;
   CustomTreeNode selectedNode = null;
   Object obj;
   private JPanel panel_1;
   private JLabel label;
   private JLabel label_1;
   private JPanel contentPane;

   /**
    * Launch the application.
    */
   public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
         public void run() {
            try {
               EmployeesSearch frame = new EmployeesSearch();
               frame.setVisible(true);
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      });
   }

   /**
    * Create the frame.
    */
   public EmployeesSearch() {
   	setUndecorated(true);
      al = esDto.select(esvo);
      EmployeesSearch(al);
      esDto.setVo(esvo);

      setFont(new Font("맑은 고딕", Font.PLAIN, 12));
      setTitle("직원선택");
      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setBounds(100, 100, 303, 333);
      contentPane = new JPanel();
      contentPane.setBackground(new Color(152,191,218));
      contentPane.setBorder(new LineBorder(new Color(0, 0, 0)));
      contentPane.setLayout(new BorderLayout(0, 0));
      setContentPane(contentPane);
      contentPane.add(getPanel(), BorderLayout.SOUTH);
      contentPane.add(getScrollPane(), BorderLayout.CENTER);
      contentPane.add(getPanel_1(), BorderLayout.NORTH);
      selectedNode = getSelectedNode();
      addMouseListener(new MouseAdapter() {  
	      public void mousePressed(MouseEvent e) {  
	        resizing = getCursor().equals(Cursor.getDefaultCursor())? false:true;  
	        if(!e.isMetaDown()){  
	          point.x = e.getX();  
	          point.y = e.getY();  
	        }  
	      }  
	    });  
	addMouseMotionListener(new MouseMotionAdapter() {  
	      public void mouseDragged(MouseEvent e) {  
	        if(resizing){  
	          Point pt = e.getPoint(); 
	          setSize(getWidth()+pt.x - point.x, getHeight()+pt.y-point.y);  
	          point.x = pt.x;  
	          point.y = pt.y;
	        }  
	        else if(!e.isMetaDown()){  
	        Point p = getLocation();  
	        setLocation(p.x + e.getX() - point.x,  
	            p.y + e.getY() - point.y);  
	        }  
	      }  
	      public void mouseMoved(MouseEvent me){  
	        Point cursorLocation = me.getPoint();  
	        int xPos = cursorLocation.x;  
	        int yPos = cursorLocation.y;  
	        if(xPos < 5) setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));  
	        else if(xPos > getContentPane().getWidth()-5) setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));  
	        else if(yPos < 5) setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));  
	        else if(yPos > getContentPane().getHeight()-5) setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));  
	        else if(getCursor().equals(Cursor.getDefaultCursor()) == false) setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));  
	      }  
	    });   

   }

   public void addEmployeeFrame(int n, Object ob) { // 어떤 프레임에 직원을 추가할 지
      if (n == 0) {
      } else if (n == 1) {
         note_f = (Note) ob;
      } else if (n == 2) {
         chat_f = (Chatting) ob;
      } else if (n == 3) {
         file_f = (FileTransfer) ob;
      } else if (n == 4) {
    	 main = (Main) ob;
    	 System.out.println("들어오냐");
      } 
   }
   
   public void list_type(int type, String group_name, String team_name){
	   this.type = type;
	   this.group = group_name;
	   this.team =team_name;
   }

   public void showMenu(int x, int y) {
      CustomTreeNode select = getSelectedNode();
      JPopupMenu popupMenu = new JPopupMenu("메뉴");
      JMenuItem menuItem1 = new JMenuItem("추가");
      JMenuItem menuItem2 = new JMenuItem("내 그룹에 추가");
      if(note_f !=null){
    	  if (select.isLeaf()) {
    		  popupMenu.add(menuItem1);
    	  } else {
    	      popupMenu.add(menuItem1);
    	      menuItem1.setText("그룹 전체 추가");
    	  }   
      }else if(chat_f !=null){
    	  popupMenu.add(menuItem1);
		  menuItem1.setText("채팅목록에 추가"); 	  
      }else if(file_f !=null){
    	  if (select.isLeaf()) {
    		  popupMenu.add(menuItem1);
    	  } else {
    	      popupMenu.add(menuItem1);
    	      menuItem1.setText("그룹 전체 추가");
    	  }   
      }else if(main != null){
    	  System.out.println("들어오냐?");
    	  if (select.isLeaf()) {
    		  popupMenu.add(menuItem1);
    	  }
      }
      
/*      if(main != null){
    		  popupMenu.add(menuItem2);
      }else{
    	  if (select.isLeaf()) {
    		  popupMenu.add(menuItem1);
    	  } else {
    	      popupMenu.add(menuItem1);
    	      menuItem1.setText("그룹 전체 추가");
    	  }     	  
      }*/
      
      menuItem1.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
            addEmployee();
         }
      });
      popupMenu.show(tree, x, y);
   }

   public void chat_invitation(){
	   
   }
   
	public void addEmployee() { // addEmployees to chatting, fileTransfer, Note
		selectedNode = getSelectedNode();
		obj = selectedNode.getEvo();
		CustomTreeNode temp;
		// obj = selectedNode.getUserObject();
		// String m_id = selectedNode.getM_id();

		if (note_f != null) {
			
		} 
		else if (chat_f != null) {
			chat_set();
		} 
		else if (file_f != null) {
			
		}else if(main != null){
			add_member();
		}
		dispose();
	}

	public void add_member(){
		selectedNode = getSelectedNode();
		main.add_user_name.setEmployee_name( selectedNode.getEvo().getEmployee_name());
		main.add_user_name.setEmployee_position(selectedNode.getEvo().getEmployee_position());
		main.add_user_name.setGroup(selectedNode.getEvo().getGroup());
		main.add_user_name.setTeam(selectedNode.getEvo().getTeam());
		main.add_user_name.setM_id(selectedNode.getEvo().getM_id());
	
		main.add_user_name.setCp_group(group);
		main.add_user_name.setCp_team(team);
		main.list_commit(type);
	}
	
	public void chat_set(){		
		ChattingVO chattingVo = new ChattingVO();	
		chattingVo.setCommand(chattingVo.INVITE);		
		chattingVo.setM_id(chat_f.getM_id());				
		chattingVo.setE_name(chat_f.getE_name());
		chattingVo.setE_position(chat_f.getE_position());
		chattingVo.setPort(chat_f.getPort());
		try {
			chatting();										// 4. 채팅창 실행. 
	         Vector<String> copy = new Vector<String>();
	         for(int i=0; i<v_selected.size(); i++){
	            copy.add(v_selected.get(i));         
	            System.out.println("v_selected 초대명단의 아이디 : " + v_selected.get(i));
	            System.out.println("copy 초대명단의 아이디 : " + copy.get(i));
	         }
	         chattingVo.setObj(copy);
	         
	       chat_f.getClientThread().getOos().writeObject(chattingVo);
	       chat_f.getClientThread().getOos().flush();
	       
			v_selected.clear();								// 벡터를 초기화
			v_selected.removeAllElements();
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}
	
	protected void chatting() {
		selectedNode = getSelectedNode();	   
	    CustomTreeNode temp;
		if (selectedNode.isLeaf()) {
			v_selected.add(selectedNode.getEvo().getM_id());						// 아이디 셋팅 
			System.out.println("EmployeesSearch 채팅 : 1명 다시 갱신 / " + v_selected);
		} else {
			 if (selectedNode.getDepth() == 1) {
	               for (int i = 0; i < selectedNode.getChildCount(); i++) {
	            	   temp = (CustomTreeNode) selectedNode.getChildAt(i);
	            	   v_selected.add(temp.getEvo().getM_id());							// 아이디 셋팅 
	               }
	            } else if (selectedNode.getDepth() == 2) {
	               for (int i = 0; i < selectedNode.getChildCount(); i++) {
	                  for (int j = 0; j < selectedNode.getChildAt(i).getChildCount(); j++) {
	                	  temp = (CustomTreeNode) selectedNode.getChildAt(i).getChildAt(j);
	                	  v_selected.add(temp.getEvo().getM_id());						// 아이디 셋팅
	                  }
	               }
	            }
	            System.out.println("EmployeesSearch 채팅 : 그룹  갱신 / " + v_selected + selectedNode.getLeafCount());
		}
	}

   public void EmployeesSearch(ArrayList<EmployeeSearchVO> al) {
      
	   int gr_c = 0;
	   int te_c = 0;
	   int em_c = 0;
	   
      EmployeeSearchVO evo =  new EmployeeSearchVO();
      evo.setGroup("전체 직원");
      evo.setTeam("전체 팀");
      
      dm_root = new CustomTreeNode("전체 직원", evo);
      
      for (int i = 0; i < al.size(); i++) {
         int group_num = -1;
         int team_num = -1;

         EmployeeSearchVO v = al.get(i);
         
         if (dm_root.getChildCount() >= 1) { // 루트 이하에 값이 있다면
            for (int group_count = 0; group_count < dm_root.getChildCount(); group_count++) {
//               System.out.println("그룹 카운트 번호 " + group_count);
//               System.out.println("dm_root.getChildAt(group_count) "
//                     + dm_root.getChildAt(group_count));
//               System.out.println("v.getGroup()  " + v.getGroup());

               if (v.getGroup().equals(
                     dm_root.getChildAt(group_count).toString())) {
//                  System.out.println(v.getGroup());
                  group_num = group_count;
//                  System.out.println("그룹까지 들어옴" + group_count);
                  for (int team_count = 0; team_count < dm_root
                        .getChildAt(group_count).getChildCount(); team_count++) {
                     if (v.getTeam().equals(
                           dm_root.getChildAt(group_count)
                                 .getChildAt(team_count).toString())) {
                        team_num = team_count;
//                        System.out.println("팀까지 들어옴" + group_count
//                              + team_count);
                        break;
                     }// end if -team
                  }// end for -team
                  break;
               }// end if - group
            }// end for - group
         }
         
         if (group_num == -1) { // 새 그룹을 생성
            dm_group = new CustomTreeNode(v.getGroup()); // 루트에 값을
                                                      // 생성
            dm_team = new CustomTreeNode(v.getTeam());
            dm_root.add(dm_group);
            dm_group.add(dm_team);
            dm_name = new CustomTreeNode(v.getEmployee_name(),v);
            dm_team.add(dm_name);

            System.out.println(v.getGroup() + "가 루트에 추가됨");
            System.out.println("-정보-");
            System.out.println("dm_group, name :" + v.getGroup());
            System.out.println("dm_team, name :" + v.getTeam());
            System.out.println("dm_name, name :" + v.getEmployee_name());
            System.out.println("-------------------------------------");
            gr_c++;
            em_c++;
         }
         else { // 기존 그룹에 추가
            if (team_num == -1) { // 기존 그룹의 새 팀을 추가
               System.out.println("기존그룹("+dm_root.getChildAt(group_num)+")에 + 팀("+v.getTeam()+") 생성으로 이동됨");
               dm_group = (CustomTreeNode) dm_root.getChildAt(group_num);
               dm_team = new CustomTreeNode(v.getTeam());
               dm_name = new CustomTreeNode(v.getEmployee_name(),v);
               dm_team.add(dm_name);
               dm_group.add(dm_team);
               System.out.println("-정보-");
               System.out.println("dm_group, name :" + dm_root.getChildAt(group_num));
               System.out.println("dm_team, name :" + v.getTeam());
               System.out.println("dm_name, name :" + v.getEmployee_name());
               System.out.println("-------------------------------------");
               te_c++;
               em_c++;
            } else {
               System.out.println("기존그룹("+dm_root.getChildAt(group_num)+") - 팀("+
            dm_root.getChildAt(group_num).getChildAt(team_num)+")에 추가로 이동됨");
               dm_group = (CustomTreeNode) dm_root.getChildAt(group_num);
               dm_team = (CustomTreeNode) dm_root.getChildAt(
                     group_num).getChildAt(team_num);

               dm_name = new CustomTreeNode(v.getEmployee_name(),v);
               dm_team.add(dm_name);
               System.out.println("-정보-");
               System.out.println("dm_group, name :" + dm_root.getChildAt(group_num));
               System.out.println("dm_team, name :" + dm_root.getChildAt(group_num).getChildAt(team_num));
               System.out.println("dm_name, name :" + v.getEmployee_name());
               System.out.println("-------------------------------------");
               
               em_c++;
            }
         }
      }// end for
      System.out.println("gr_c : " + gr_c);
      System.out.println("te_c : " + te_c);
      System.out.println("em_c : " + em_c);
      if (check) {
         this.scrollPane.setViewportView(setTree_1(dm_root));
      } else {
         check = true;
      }
   }

   private JPanel getPanel() {
      if (panel == null) {
         panel = new JPanel();
         panel.setBorder(new EmptyBorder(5, 5, 5, 5));
         panel.setBackground(new Color(152,191,218));
         panel.setLayout(new BorderLayout(0, 0));
         panel.add(getBtn_search(), BorderLayout.EAST);
         panel.add(getTxt_search(), BorderLayout.CENTER);
      }
      return panel;
   }

   private JScrollPane getScrollPane() {
      if (scrollPane == null) {
         scrollPane = new JScrollPane();
         scrollPane.setViewportView(getTree());
      }
      return scrollPane;
   }

   private JButton getBtn_search() {
      if (btn_search == null) {
         btn_search = new JButton("검  색");
         btn_search.setForeground(Color.DARK_GRAY);
         btn_search.setBackground(new Color(152,191,218));
         btn_search.setBorder(new EmptyBorder(0, 10, 0, 10));
         btn_search.setFont(new Font("맑은 고딕", Font.BOLD, 12));
         btn_search.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {               
            	   esvo.setFind(txt_search.getText());
            	   al = esDto.select(esvo);
                   EmployeesSearch(al);
                   expandTree(tree);
                   txt_search.setText("");    
            }
         });
      }
      return btn_search;
   }

   private JTree getTree() {
      if (tree == null) {
         tree = new JTree(dm_root){
            public String getToolTipText(MouseEvent evt) {
               if (getRowForLocation(evt.getX(), evt.getY()) == -1)
                  return null;
               TreePath curPath = getPathForLocation(evt.getX(), evt.getY());
               return ((CustomTreeNode) curPath.getLastPathComponent())
                     .getM_id();
            }
         };
         tree.setBorder(new EmptyBorder(5, 5, 5, 5));
         tree.setToolTipText("");
         tree.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
         tree.setDragEnabled(true);
         tree.setDropMode(DropMode.ON_OR_INSERT);
         tree.getSelectionModel().setSelectionMode(
               TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);

         renderer = new ToolTipTreeCellRenderer(tree);
         tree.setCellRenderer(renderer);

         tree.addMouseListener(new MouseAdapter() { // 트리를 눌렀을 때
            public void mousePressed(MouseEvent event) {
               if (SwingUtilities.isRightMouseButton(event)) {
                  int row = tree.getClosestRowForLocation(event.getX(), event.getY());            
                  tree.setSelectionRow(row);
               }
               if ((( InputEvent.BUTTON3_MASK) != 0)
                     && (tree.getSelectionCount() > 0)) {
                  showMenu(event.getX(), event.getY());
               }
            }

            @Override
            public void mouseClicked(MouseEvent e) {
               CustomTreeNode selectedNode = getSelectedNode();
               
               System.out.println( "선택된 노드의 아이디 : " + selectedNode.getM_id());
               selectedNode.getNextSibling();
               int row = 0;
               if (SwingUtilities.isLeftMouseButton(e)) {
                  row = tree.getClosestRowForLocation(e.getX(), e.getY());
                  tree.setSelectionRow(row);
               }
               
               System.out.println("선택된 노드의 번호 " + row);
               
               if (e.getClickCount() == 2) {
                  if (click_number == row || selectedNode.getDepth() == 0) {
                     click_number = -1;
                     
                     addEmployee();
                  } else {
                     click_number = row;
                     tree.expandRow(row);
                  }
               }
            }
         });
      }
      return tree;
   }

   public JTree setTree_1(CustomTreeNode dm_group) {
      tree = new JTree(dm_root){
         public String getToolTipText(MouseEvent evt) {
            if (getRowForLocation(evt.getX(), evt.getY()) == -1)
               return null;
            TreePath curPath = getPathForLocation(evt.getX(), evt.getY());
            return ((CustomTreeNode) curPath.getLastPathComponent())
                  .getM_id();
         }
         
      };
      tree.setToolTipText("");
      tree.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
      tree.addMouseListener(new MouseAdapter() { // 트리를 눌렀을 때
          public void mousePressed(MouseEvent event) {
             if (SwingUtilities.isRightMouseButton(event)) {
                int row = tree.getClosestRowForLocation(event.getX(), event.getY());            
                tree.setSelectionRow(row);
             }
             if ((( InputEvent.BUTTON3_MASK) != 0)
                   && (tree.getSelectionCount() > 0)) {
                showMenu(event.getX(), event.getY());
             }
          }

          @Override
          public void mouseClicked(MouseEvent e) {
             CustomTreeNode selectedNode = getSelectedNode();
             
             System.out.println( "선택된 노드의 아이디 : " + selectedNode.getM_id());
             selectedNode.getNextSibling();
             int row = 0;
             if (SwingUtilities.isLeftMouseButton(e)) {
                row = tree.getClosestRowForLocation(e.getX(), e.getY());
                tree.setSelectionRow(row);
             }
             
             System.out.println("선택된 노드의 번호 " + row);
             
             if (e.getClickCount() == 2) {
                if (click_number == row || selectedNode.getDepth() == 0) {
                   click_number = -1;
                   
                   addEmployee();
                } else {
                   click_number = row;
                   tree.expandRow(row);
                }
             }
          }
       });
      return tree;
   }

   private JTextField getTxt_search() {
      if (txt_search == null) {
         txt_search = new JTextField();
         txt_search.addKeyListener(new KeyAdapter() {
         	@Override
         	public void keyReleased(KeyEvent e) {
         		if(e.getKeyCode() == KeyEvent.VK_ENTER){
					btn_search.doClick();
					txt_search.setText("");
				}
         	}
         });
         txt_search.setToolTipText("이름, 아이디, 부서명을 입력해주세요.");
         txt_search.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
         txt_search.setColumns(10);
      }
      return txt_search;
   }

   public void expandTree(JTree tree) { // 검색했을 때 펼쳐져서 나옴
      CustomTreeNode dm_root = (CustomTreeNode) tree
            .getModel().getRoot();
      Enumeration e = dm_root.breadthFirstEnumeration();
      while (e.hasMoreElements()) {
         CustomTreeNode node = (CustomTreeNode) e
               .nextElement();
         if (node.isLeaf())
            continue;
         int row = tree.getRowForPath(new TreePath(node.getPath()));
         tree.expandRow(row);
      }
   }

   private CustomTreeNode getSelectedNode() {
      return (CustomTreeNode) tree.getLastSelectedPathComponent();
   }
   
   public void setTxt_search(String search) {
	   txt_search.setText(search);
   }
   
   
   

   static private class ToolTipTreeCellRenderer extends DefaultTreeCellRenderer {
      TreePath oldSelectedPath = null;

      private ToolTipTreeCellRenderer(JTree tree) {
         tree.addMouseMotionListener(new MouseMotionListener() {
            public void mouseDragged(MouseEvent mouseEvent) {
               // Nothing to do
            }
            public void mouseMoved(MouseEvent mouseEvent) {
               DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel();
               int selRow = tree.getRowForLocation(mouseEvent.getX(), mouseEvent.getY());
               if (selRow < 0) {
                  
                  TreePath currentSelected = oldSelectedPath;
                  oldSelectedPath = null;
                  if (currentSelected != null)
                     treeModel.nodeChanged((TreeNode) currentSelected.getLastPathComponent());
                  
               } 
               else {
                  
                  tree.setSelectionRow(selRow);
                  TreePath selectedPath = tree.getPathForLocation(mouseEvent.getX(), mouseEvent.getY());
                  if ((oldSelectedPath == null) || !selectedPath.equals(oldSelectedPath)) {
                     oldSelectedPath = selectedPath;
                     treeModel.nodeChanged((TreeNode) oldSelectedPath.getLastPathComponent());
                  }
               }
               tree.repaint();
            }
         });
      }

   }

	private JPanel getPanel_1() {
		if (panel_1 == null) {
			panel_1 = new JPanel();
			panel_1.setBorder(new EmptyBorder(5, 5, 5, 5));
			panel_1.setBackground(new Color(152,191,218));
			panel_1.setLayout(new BorderLayout(0, 0));
			panel_1.add(getLabel(), BorderLayout.WEST);
			panel_1.add(getLabel_1(), BorderLayout.EAST);
		}
		return panel_1;
	}
	private JLabel getLabel() {
		if (label == null) {
			label = new JLabel("직원 찾기");
			label.setForeground(Color.DARK_GRAY);
			label.setFont(new Font("맑은 고딕", Font.BOLD, 12));
		}
		return label;
	}
	private JLabel getLabel_1() {
		if (label_1 == null) {
			label_1 = new JLabel("");
			label_1.setIcon(new ImageIcon("C:\\Program Files\\Mino Corp\\system\\close.png"));
			label_1.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent e) {
					dispose();
				}
			});
			label_1.setForeground(Color.DARK_GRAY);
			label_1.setFont(new Font("맑은 고딕", Font.BOLD, 13));
			label_1.setBackground(new Color(173, 216, 230));
		}
		return label_1;
	}
}